/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.androgen.androGenDsl.impl;

import hu.bme.mit.androtext.androapp.androAppDsl.AndroAppDslPackage;

import hu.bme.mit.androtext.androgen.androGenDsl.AndroGenDslFactory;
import hu.bme.mit.androtext.androgen.androGenDsl.AndroGenDslPackage;
import hu.bme.mit.androtext.androgen.androGenDsl.AndroidGeneratorModel;
import hu.bme.mit.androtext.androgen.androGenDsl.ApiLevel;
import hu.bme.mit.androtext.androgen.androGenDsl.TargetApplication;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class AndroGenDslPackageImpl extends EPackageImpl implements AndroGenDslPackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass androidGeneratorModelEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass targetApplicationEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EEnum apiLevelEEnum = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see hu.bme.mit.androtext.androgen.androGenDsl.AndroGenDslPackage#eNS_URI
   * @see #init()
   * @generated
   */
  private AndroGenDslPackageImpl()
  {
    super(eNS_URI, AndroGenDslFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link AndroGenDslPackage#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static AndroGenDslPackage init()
  {
    if (isInited) return (AndroGenDslPackage)EPackage.Registry.INSTANCE.getEPackage(AndroGenDslPackage.eNS_URI);

    // Obtain or create and register package
    AndroGenDslPackageImpl theAndroGenDslPackage = (AndroGenDslPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AndroGenDslPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AndroGenDslPackageImpl());

    isInited = true;

    // Initialize simple dependencies
    AndroAppDslPackage.eINSTANCE.eClass();

    // Create package meta-data objects
    theAndroGenDslPackage.createPackageContents();

    // Initialize created meta-data
    theAndroGenDslPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theAndroGenDslPackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(AndroGenDslPackage.eNS_URI, theAndroGenDslPackage);
    return theAndroGenDslPackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getAndroidGeneratorModel()
  {
    return androidGeneratorModelEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidGeneratorModel_TargetApplications()
  {
    return (EReference)androidGeneratorModelEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getTargetApplication()
  {
    return targetApplicationEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getTargetApplication_Application()
  {
    return (EReference)targetApplicationEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTargetApplication_ProjectName()
  {
    return (EAttribute)targetApplicationEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTargetApplication_PackageName()
  {
    return (EAttribute)targetApplicationEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTargetApplication_Target()
  {
    return (EAttribute)targetApplicationEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EEnum getApiLevel()
  {
    return apiLevelEEnum;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroGenDslFactory getAndroGenDslFactory()
  {
    return (AndroGenDslFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    androidGeneratorModelEClass = createEClass(ANDROID_GENERATOR_MODEL);
    createEReference(androidGeneratorModelEClass, ANDROID_GENERATOR_MODEL__TARGET_APPLICATIONS);

    targetApplicationEClass = createEClass(TARGET_APPLICATION);
    createEReference(targetApplicationEClass, TARGET_APPLICATION__APPLICATION);
    createEAttribute(targetApplicationEClass, TARGET_APPLICATION__PROJECT_NAME);
    createEAttribute(targetApplicationEClass, TARGET_APPLICATION__PACKAGE_NAME);
    createEAttribute(targetApplicationEClass, TARGET_APPLICATION__TARGET);

    // Create enums
    apiLevelEEnum = createEEnum(API_LEVEL);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    AndroAppDslPackage theAndroAppDslPackage = (AndroAppDslPackage)EPackage.Registry.INSTANCE.getEPackage(AndroAppDslPackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes

    // Initialize classes and features; add operations and parameters
    initEClass(androidGeneratorModelEClass, AndroidGeneratorModel.class, "AndroidGeneratorModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getAndroidGeneratorModel_TargetApplications(), this.getTargetApplication(), null, "targetApplications", null, 0, -1, AndroidGeneratorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(targetApplicationEClass, TargetApplication.class, "TargetApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getTargetApplication_Application(), theAndroAppDslPackage.getAndroidApplication(), null, "application", null, 0, 1, TargetApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTargetApplication_ProjectName(), ecorePackage.getEString(), "projectName", null, 0, 1, TargetApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTargetApplication_PackageName(), ecorePackage.getEString(), "packageName", null, 0, 1, TargetApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTargetApplication_Target(), this.getApiLevel(), "target", null, 0, 1, TargetApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Initialize enums and add enum literals
    initEEnum(apiLevelEEnum, ApiLevel.class, "ApiLevel");
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API8);
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API9);
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API10);
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API11);
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API12);
    addEEnumLiteral(apiLevelEEnum, ApiLevel.API14);

    // Create resource
    createResource(eNS_URI);
  }

} //AndroGenDslPackageImpl
